<?php
namespace Admin\Controller;
use Think\Controller;
class CardController extends CommonController {
	public function index()
	{
		$this->_page("Card",$num='10',$order="create_time");
		$this->display();
	}
	public function delete()
	{
		$name="Card";
    	$sid=I("post.sid");
    	$this->_foreverdelete($name,$sid);
	}
	public function edit()
	{
		$name="Card";
		if (!empty($_POST)) {
			$this->_update($name);
		}else{
		  $this->_edit($name);
	  }
	}
		public function insert()
	{
		if (!empty($_POST)) {
		$name="Card";
		$this->_insert($name);
		}else{
		$this->display();
		}
	}
	//状态修改
    //修改状态
    public function status()
    {

        	$Site=D("Card");
    			C('TOKEN_ON',false);
            if ($Site->create()) {
                $list=$Site->save();
                if ($list!=false) {
                    $this->ajaxReturn('修改成功');
                    
                }else{
                    $this->ajaxReturn('修改失败');
                }
            }else{
                $this->ajaxReturn($Site->getError());
            }
    }
}